export function deepCopy(obj) {
  if (typeof obj !== "object" || obj === null) {
    return obj;
  }
  let copy = Array.isArray(obj) ? [] : {};
  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {
      copy[key] = deepCopy(obj[key]);
    }
  }
  return copy;
}

export function objToMap(obj) {
  let map = new Map();
  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {
      map.set(key, obj[key]);
    }
  }
  return map;
}

export function arrExitObj(arr,obj){
  if(arr.length === 0 ) return false;
  return arr.some(item =>
    Object.keys(obj).every(key => item[key] === obj[key])
  )
}